<script>
$(function() {
	$( ".datepick" ).datepicker({
								 changeMonth: true,
								dateFormat: "dd-mm-yy",
								showOn: "both",
								buttonImage:$('#root').val()+"img/calendar.jpg",
								buttonImageOnly: true
	 							});
	$(".datepick").keydown(function(e) {
        if ( e.keyCode != 13) {}
        else 
            {
                e.preventDefault(); 
            }   
        }
    );
});
</script>
<div id="tabs">
	<ul>
        <li id="current"><?php echo $this->Html->link(__('Báo cáo ngày', true),  array('controller'=>'kqbanhangs','action'=>'kqbhngaynv',$this->Session->read('cur_dv'),$this->Session->read('cur_manv')));?></li>
        <li><?php echo $this->Html->link(__('Báo cáo tuần', true), array('controller'=>'kqbanhangs','action'=>'kqbhtuannv',$this->Session->read('cur_dv'),$this->Session->read('cur_manv')));?></li>
        <li><?php echo $this->Html->link(__('Báo cáo tháng', true),  array('controller'=>'kqbanhangs','action'=>'kqbhthangnv',$this->Session->read('cur_dv'),$this->Session->read('cur_manv')));?></li>
        <li><?php echo $this->Html->link(__('Chỉ tiêu SXKD lũy kế', true),  array('controller'=>'kqbanhangs','action'=>'luyke',$this->Session->read('cur_manv')));?></li>
        <li><?php echo $this->Html->link(__('Danh sách nhân viên', true),  array('controller'=>'nhanviens','action'=>'kqbanhang',$this->Session->read('cur_dv')));?></li>
	</ul>
</div>
<?php
echo $form->create('Kqbanhang');
echo $form->input('root',array('id'=>'root','type'=>'hidden','value'=>$this->webroot));
echo '<h2>Vui lòng chọn Nhân Viên và Ngày muốn xem báo cáo kết quả bán hàng</h2>';
echo "<table>";
echo "<tr  width=200><td width=200>";
echo $form->input('nhanvien',array('id'=>'nhanvien','label'=>'Nhân Viên','options'=>$nhanvien,'empty'=>"Chọn Nhân Viên",'selected'=>$nhanvien_id));
echo "</td>";
echo "<td>";
echo $this->Form->input('ngay',array('type'=>'text','label'=>'Ngày','class'=>'datepick'));
echo "</td>";
echo "<td align='center'>";
echo $js->submit('Xem', array(
								'url'=> array('controller'=>'kqbanhangs', 'action'=>'kqngaynv'),
 								'update' => '#kq'));
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<div id='kq'></div>";
/*$this->Js->get('.datepick')->event('change',
							$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'kqngaynv'),
							array('update' => '#kq','async' => true,
							'dataExpression' => true,'method' => 'post',
							'data' => $js->serializeForm(array('isForm' => false, 'inline' => true)))));
$this->Js->get('#nhanvien')->event('change',
							$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'kqngaynv'),
							array('update' => '#kq','async' => true,
							'dataExpression' => true,'method' => 'post',
							'data' => $js->serializeForm(array('isForm' => false, 'inline' => true)))));
							
*/
echo $form->end();
?>